﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using RESTServices.Dominio;
using RESTServices.Persistencia;

namespace RESTServices
{
  public class Combos : ICombos
    {
      //
      public ComboDAO dao = new ComboDAO();
        public Combo CrearCombo(Combo comboAcrear)
        {
            return dao.Crear(comboAcrear);
        }

        public Combo ObtenerCombo(string codigo)
        {
            return dao.Obtener(int.Parse(codigo));
        }

        public Combo ModificarCombo(Combo comboAModificar)
        {
            return dao.Modificar(comboAModificar);
        }

        public void EliminarCombo(string codigo)
        {
            dao.Eliminar(ObtenerCombo(codigo));
        }

        public List<Combo> ListarCombos()
        {
            return dao.ListarTodos().ToList();
        }
    }
}
